package com.sugar.queryinfo.module.business.dal.mysql.dataqueryxfhx;

import com.sugar.queryinfo.framework.common.pojo.PageResult;
import com.sugar.queryinfo.framework.mybatis.core.query.LambdaQueryWrapperX;
import com.sugar.queryinfo.framework.mybatis.core.mapper.BaseMapperX;
import com.sugar.queryinfo.module.business.controller.admin.data.dataqueryxfhx.vo.DataQueryXfhxPageReqVO;
import com.sugar.queryinfo.module.business.dal.dataobject.dataqueryxfhx.DataQueryXfhxDO;
import org.apache.ibatis.annotations.Mapper;

/**
 * 数据查询-逾期探查报告 Mapper
 *
 * @author Ysugar
 */
@Mapper
public interface DataQueryXfhxMapper extends BaseMapperX<DataQueryXfhxDO> {

    default PageResult<DataQueryXfhxDO> selectPage(DataQueryXfhxPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<DataQueryXfhxDO>()
                .eqIfPresent(DataQueryXfhxDO::getUserId, reqVO.getUserId())
                .eqIfPresent(DataQueryXfhxDO::getDeptId, reqVO.getDeptId())
                .eqIfPresent(DataQueryXfhxDO::getDataId, reqVO.getDataId())
                .betweenIfPresent(DataQueryXfhxDO::getQueryTime, reqVO.getQueryTime())
                .betweenIfPresent(DataQueryXfhxDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(DataQueryXfhxDO::getId));
    }

}